#include "cell.h"
#include <QPixmap>
#include <QPainter>
#include <QColor>
#include <QDebug>

Cell::Cell(int size, int x, int y, QColor color, QGraphicsItem* parent):
    mSize(size),
    mX(x),
    mY(y),
    QGraphicsPixmapItem(parent)
{
    setPixmap(*createPixmap(size, size, color));
}

QPixmap* Cell::createPixmap(int width,
                            int height,
                            QColor color){
    QPixmap* pixmap = new QPixmap(width, height);
    QPainter painter(pixmap);
    painter.fillRect(0, 0, width, height, color);
    QColor boundColor(186, 186, 186);
    painter.setPen(boundColor);
    painter.drawRect(0, 0, width, height);
    return pixmap;
}
